/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package backbeans;

import imp.base.ValidationClass;
import interfaces.base.UIBean;
import interfaces.base.BaseBean;
import interfaces.base.ValidateInt;
import java.awt.Dimension;
import pojo.Logon;
import sun.awt.X11.Screen;
import ui.GreetingScreen;

/**
 *
 * @author eisa
 */

public class LoginBean extends Logon  implements BaseBean,ValidateInt {

    private UIBean logOnUi;
    
    
    public void save()
    {
    System.out.println("welcome To save");
    
    logOnUi.showError(new ValidationClass(null, "generalError", "User name or password are invalid"));
    
    
    /*
    logOnUi.closeUi();
    GreetingScreenBean greetingScreenBean=new GreetingScreenBean();
    GreetingScreen greetingScreen=new GreetingScreen();
    greetingScreen.register(greetingScreenBean);
    greetingScreenBean.register(logOnUi);
    greetingScreen.setPreferredSize(new Dimension(400,400));
    greetingScreen.setVisible(true);    
     */ 
    }
    
    public void exit()
    {
    System.out.println("exit");
    logOnUi.closeUi();
    }
    public void register(UIBean obj) {
        logOnUi=obj;
    }

    public ValidationClass valid(String componentName, String componentValue) {
        
        ValidationClass validationClass=null;
        
        return validationClass;
    }
    
}
